# coding=utf-8
from numpy import array

# 中括号可以
mm = array([1, 1, 1])
print("mm:{0}".format(mm))
# 小括号也可以
pp = array((2, 3, 4))
print("pp:{0}".format(pp))
print("mm+pp:{0}".format(mm + pp))
print("pp**2:{0}".format(pp ** 2))
print("pp[1]:{0}".format(pp[1]))

#二维数组
ma = array([
    [1, 2, 3],
    [1, 1, 1]
])
print "ma:{0}".format(ma)
print "ma[0]:{0}".format(ma[0])
print "ma[0][1]:{0}".format(ma[0][1])
# 矩阵方式访问
print "ma[0,1]:{0}".format(ma[0,1])
